<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="org.apache.log4j.Logger" %>
<%@ page import="java.util.*" %>
<%@ page import = "com.common.servlet.AttributeListener" %>
<%@ page import = "com.auth.domain.*" %>
<% session = request.getSession(false); %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html lang="UTF-8">
  <head>
    <title>在线用户管理页面</title>
    <%@ include file="meta.jsp"%>
    <!-- <meta http-equiv="refresh" content="5"> -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="X-UA-Compatible" content="IE=9">
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <link rel="stylesheet" href="<%=basePath%>css/my-bootstrap.css" media="screen" id="tuserskin">
    <link rel="stylesheet" href="<%=basePath%>js/toastr/toastr.css">
    <link rel="stylesheet" href="<%=basePath%>css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="<%=basePath%>css/font-awesome.min.css">
    <script type="text/javascript" src="<%= basePath %>js/jquery.cookie.js"></script>
  </head>
  <style>
hr {
    margin-top:1px;
    border-bottom: 1px solid #1BBC9B;
}
  </style>
  <body>
  <form class="form-horizontal form-bordered form-row-strippe" name="ffAdd" id="ffAdd" mentod="post" role="form" data-toggle="validator" enctype="multipart/form-data">
  <div class="" style="margin-right:2px;padding-right:1px;">
<%

%>

   <!-------------------------- 面板  start--------------------------------->
	<div class="panel panel-primary" >
	   <div class="panel-heading clearfix"  id="addHeaderDiv"><i class="icon-comment-alt icon-large"></i>&nbsp;在线用户信息</div>
	   <div class="panel-body">
		    <p>
				  <%
				  Date date = new Date();
				  out.print("    当前时间："+(date.getYear()+1900)+"年");
				  out.print((date.getMonth()+1)+"月");
				  out.print(date.getDate()+"日");
				  out.print(date.getHours()+"时");
				  out.print(date.getMinutes()+"分");
				  out.print(date.getSeconds()+"秒");
				  %>在线用户列表：
		    </p>

	  		<table id="grid" class="table table-condensed table-striped table-bordered table-hover" class="sortable" cellpadding="0" cellspacing="0" border="0" class="display" width="100%">
		     <thead id="grid_head">
		      <tr>
		          <th onclick="sortTableT.sort('grid',0,'String')">操作员账号</th>
		          <th onclick="sortTableT.sort('grid',0,'String')">登录ip</th>
		          <th onclick="sortTableT.sort('grid',0,'String')">登录时间</th>
		          <th style="width:150px">操作</th>
		      </tr>
		     </thead>
		     <tbody id="grid_body">
 <%
				  Map users = AttributeListener.getOnlineSession();  //AttributeListener.getOnlineUsers();
				  out.println("size:"+users.size());
					if(users!= null){
						Iterator it = users.keySet().iterator();
					    while(it.hasNext()){
					    	//T_user sys_user = (T_user)it.next();
					    	String username = (String)it.next();;
					    	 //out.println("<br>操作员账号："+username+";登录ip："+sys_user.getMemo2()+";登录时间："+sys_user.getMemo3());
				  %>
		     	<tr><td><%=username %></td><td></td><td></td><td>强制下线</td></tr>
                 <% 	}
					} %>
		     </tbody>
		    </table>

       </div><!--end body-->
	   <div class="modal-footer bg-info " id='buttonDiv'>
 			<!--  -->
 			<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal" onclick="window.location.href='<%=basePath%>/main/main-portal'">返回首页</button>

	   </div>
    </div>
    <!--------------------------面板 end------------------------------------>

  </div>
  </form>
  </body>
</html>

<script src="<%=basePath%>js/bootstrap.min.js"></script>
<!--<script type="text/javascript" src="js/bootstrapValidator.js"></script>-->
<script src="<%=basePath%>js/bootstrap-paginator.min.js"></script>
<script src="<%=basePath%>/js/respond.js"></script>
<script src="<%=basePath%>/js/html5.js"></script>
<script src="<%=basePath%>js/toastr/toastr.js"></script>
<script src="<%=basePath%>js/bootbox.js"></script>
<script src="<%=basePath%>js/jquery.validate.js"></script>
<!-- <script src="<%=basePath%>js/additional-methods.min.js"></script> -->
<script src="<%=basePath%>js/my-jquery-curd.js"></script>
<script src="<%= basePath %>js/tableSortTool.js" ></script>
<script src="<%= basePath %>js/calendar.js" ></script>




